import dict from '@/const/dict/dict';

export default {
  height: 'auto',
  calcHeight: 30,
  tip: false,
  searchShow: true,
  border: true,
  index: true,
  viewBtn: true,
  selection: true,
  dialogClickModal: false,
  grid: false,
  gridBtn: false,
  dialogDrag: true,
  defaultSort: {
    prop: 'updateTime',
    order: 'descending'
  },
  column: [
    {
      label: '主键',
      prop: 'id',
      type: 'input',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      hide: true
    },
    {
      label: '接码平台',
      prop: 'serviceApiId',
      type: 'select',
      dicUrl: '/biz/search/select/sms-api',
      dicHeaders: { crypto: true },
      dicMethod: 'post',
      dataType: 'string',
      props: {
        label: 'dictValue',
        value: 'dictKey'
      },
      search: true,
      searchSpan: 6,
      searchLabelWidth: 100,
      disabled: false,
      rules: [{
        required: true,
        message: '请输入SMS接码平台',
        trigger: 'blur'
      }]
    },
    {
      label: '国家/地区',
      prop: 'countryId',
      type: 'select',
      dicUrl: '/biz/search/select/country',
      dicHeaders: { crypto: true },
      dicMethod: 'post',
      dataType: 'string',
      props: {
        label: 'dictValue',
        value: 'dictKey'
      },
      search: true,
      searchSpan: 6,
      searchLabelWidth: 105,
      width: 250,
      filterable: true,
      virtualize: true,
      rules: [{
        required: true,
        message: '请选择国家/地区',
        trigger: 'blur'
      }]
    },
    {
      label: '映射ID',
      prop: 'mappingId',
      type: 'input',
      search: true,
      searchSpan: 4,
      rules: [{
        required: true,
        message: '请输入映射ID',
        trigger: 'blur'
      }]
    },
    {
      label: '运营商',
      prop: 'operatorArray',
      type: 'input',
      showOverflowTooltip: true
    },
    {
      label: '价格',
      prop: 'price',
      type: 'number',
      precision: 2,
      sortable: 'custom',
    },
    {
      label: '更新时间',
      prop: 'updateTime',
      type: 'datetime',
      format: 'YYYY-MM-DD HH:mm:ss',
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      search: true,
      searchRange: true,
      searchSpan: 8,
      searchOrder: 99,
      sortable: 'custom',
      width: 180
    },
    {
      label: '状态',
      prop: 'status',
      type: 'switch',
      dicData: dict.enable_disable,
      dataType: 'number',
      value: 1,
      search: true,
      searchSpan: 4,
      searchLabelWidth: 75,
      rules: [{
        required: true,
        message: '请输入状态',
        trigger: 'blur'
      }]
    }
  ]
};
